import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${USER}
 * Date: ${YEAR}-${MONTH}-${DAY}
 * Time: ${TIME}
 */
class Child{
    private String name;
    private int age;
    private String gender;
    private int height;

    public Child(String name, int age, String gender, int height) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.height = height;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    @Override
    public String toString() {
        if (this.gender.compareTo("M") == 0) {
            return "男孩" + this.name + "的年龄是" + this.age + "岁,身高是" + this.height + "厘米";
        }else{
            return "女孩" + this.name + "的年龄是" + this.age + "岁,身高是" + this.height + "厘米";
        }
    }
}
class heightException extends Exception{
    private String msg;

    public heightException(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return msg;
    }
}
class BodyCheck{
    private int standerdHeight;
    public void checkHeight(Child c) throws heightException {
        calcStandardHeight(c);
        int a = standerdHeight - c.getHeight();
        if (a > 0){
            throw new heightException(c.getName() + "小朋友身高不达标,还差" + a + "厘米");
        }else{
            System.out.println(c.getName() + "同学身高合格");
        }
    }
    public void calcStandardHeight(Child c){
        if (c.getGender().compareTo("M") == 0){
            standerdHeight = c.getAge() * 6 + 75;
        }else{
            standerdHeight = c.getAge() * 6 + 70;
        }
    }
}
abstract class Role {
    private String name;//名字

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //返回角色的攻击对敌人的伤害
    public abstract int attack();
}
class Magicer extends Role{
    private int level;

    @Override
    public int attack() {
        return 5 * this.level;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
class Soldier extends Role{
    private int hurt;

    @Override
    public int attack() {
        return this.hurt;
    }

    public int getHurt() {
        return hurt;
    }

    public void setHurt(int hurt) {
        this.hurt = hurt;
    }
}
class Team{
    ArrayList<Role> arrayList = new ArrayList<>();
    public void addroles(Role r){
        arrayList.add(r);
    }
    public int attackSum(){
        int sum  = 0;
        for (int i = 0; i < arrayList.size(); i++) {
            sum += arrayList.get(i).attack()
        }
        return sum;
    }
}
interface ComputePower{
    double computePower();
}
class Chip implements ComputePower{
    @Override
    public double computePower() {
        return 16.6;
    }
}
class Disctete implements ComputePower{
    @Override
    public double computePower() {
        return 40.0;
    }
}
class Phone{
    private ComputePower[] parts;

    public Phone(ComputePower[] parts) {
        this.parts = parts;
    }

    public double getTotalPower(){
        double sum = 0;
        for (int i = 0; i < parts.length; i++) {
            sum += parts[i].computePower();
        }
        return sum;
    }
}
public class Main {

}